/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package poetry.parser

import scala.swing.Publisher
import scala.swing.event.Event

class Poetry(val name: String, val body: List[Strophe]) {
  override def toString = name + "\n\n" + body.map( x => x.toString + "\n").mkString
  def bodyString = body.map( x => x.toString + "\n").mkString
}
class Strophe(val body: List[String]) {
  override def toString = body.map( x => x + "\n").mkString
}

class PoetryDatabase(private var poetryVar: List[Poetry]) {
  def poetry = poetryVar
  def poetry_=(list: List[Poetry]) = poetryVar = list
}

object PoetryPublisher extends Publisher

case object PoetryDbChanged extends Event
case object ChangesNotSaved extends Event
case object ChangesSaved extends Event